// PointEx.cpp: implementation of the CPointEx class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "PointEx.h"
#include "Element.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CPointEx::CPointEx()
{
	Empty();
}

CPointEx::CPointEx(double dPX,double dPY)
{
	m_dPX = dPX;
	m_dPY = dPY;
	m_dPZ = 0.0;
	m_dPU = 0.0;
	m_dPR = 0.0;
	m_IsEmptyState = false;
}


CPointEx::~CPointEx()
{
}

int CPointEx::operator=(const CPointEx thePoint)
{
	this->m_dPX = thePoint.m_dPX;
	this->m_dPY = thePoint.m_dPY;
	this->m_dPZ = thePoint.m_dPZ;
	this->m_dPU = thePoint.m_dPU;
	this->m_dPR = thePoint.m_dPR;
	m_IsEmptyState = false;
	return 0;
}

int CPointEx::operator=(const CPoint thePoint)
{
	this->m_dPX = thePoint.x;
	this->m_dPY = thePoint.y;
	this->m_dPZ = 0;
	this->m_dPU = 0;
	this->m_dPR = 0;
	m_IsEmptyState = false;
	return 0;
}

BOOL CPointEx::operator==(const CPointEx thePoint)
{
	if ((fabs(this->m_dPX - thePoint.m_dPX)<0.0001)&&(fabs(this->m_dPY - thePoint.m_dPY)<0.0001))
	{
		return TRUE;
	}
	else
	{
		return FALSE;
	}
}

BOOL CPointEx::operator!=(const CPointEx thePoint)
{
	if ((fabs(this->m_dPX - thePoint.m_dPX)<0.001)&&(fabs(this->m_dPY - thePoint.m_dPY)<0.001))
	{
		return FALSE;
	}
	else
	{
		return TRUE;
	}
}

bool CPointEx::IsEmpty()
{
	return m_IsEmptyState;
}
bool CPointEx::Empty()
{
	m_dPX = 0;
	m_dPY = 0;
	m_dPZ = 0;
	m_dPU = 0;
	m_dPR = 0;
	m_IsEmptyState = true;
	return true;
}